var vm = new Vue({
	el: "#datas",
	data: {
		appList: [],
		showIndex: 0,
	},
	mounted: function() {
		this.init();

	},
	methods: {
		init: function() {
			var _self = this;
			//var url = "http://m.sureserve.cn/emp/app.json?timestamp=" + new Date().getTime();
			//this.appList = apps;
			//console.log(JSON.stringify(this.appList));
			//this.showIndex = 0;
			//this.showApp(0);

			var url = "https://m.gitee.com/kylexy2009/app/raw/master/data.json?timestamp=" + new Date().getTime();
			sui.get(url, function(ret) {
				var list = JSON.parse(ret);
				_self.appList = list;
				_self.showIndex = 0;
				_self.showApp(0)
			}, function(err) {
				sui.toast("网络错误")
			})
		},
		showApp: function(index) {
			var _self = this;
			var maxIndex = this.appList.length;
			if (index < maxIndex) {
				this.$set(_self.appList[index], "show", true);
				setTimeout(function() {
					_self.showApp(index + 1)
				}, 400);
			}
		},
		openUrl: function(app) {
			window.location.href = app.url;
		}
	}
})


